package com.baomidou.springwind.entity;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 网络节点
 *
 * @author luox
 */
@TableName(value = "glc_network_supply_delivery")
public class NetworkDelivery implements Serializable {

    @TableId(type = IdType.AUTO)
    private Long id; //主键

    @TableField(value = "pid")
    private Long pId; //父级

    @TableField(value = "batch_Id")
    private Long batchId; //批次号

    @TableField(value = "name")
    private String name; //配送中心名称

    @TableField(value = "type")
    private Integer type; //配送节点类型

    @TableField(value = "lnglat_id")
    private Long lnglatId; //配送节点类型

    @TableField(value = "coordinate_x")
    private BigDecimal coordinateX; //经度

    @TableField(value = "coordinate_y")
    private BigDecimal coordinateY; //纬度

    @TableField(value = "order_quantity")
    private BigDecimal orderQuantity; //周期内订单量

    @TableField(value = "operator_id")
    private Long operatorId;//操作人

    @TableField(value = "create_time")
    private Date createTime; //创建日期

    @TableField(exist = false)
    private String batchName; //批次名称


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getBatchId() {
        return batchId;
    }

    public void setBatchId(Long batchId) {
        this.batchId = batchId;
    }

    public String getName() {
        return name;
    }

    public Long getpId() {
        return pId;
    }

    public void setpId(Long pId) {
        this.pId = pId;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public BigDecimal getCoordinateX() {
        return coordinateX;
    }

    public void setCoordinateX(BigDecimal coordinateX) {
        this.coordinateX = coordinateX;
    }

    public BigDecimal getCoordinateY() {
        return coordinateY;
    }

    public void setCoordinateY(BigDecimal coordinateY) {
        this.coordinateY = coordinateY;
    }

    public BigDecimal getOrderQuantity() {
        return orderQuantity;
    }

    public void setOrderQuantity(BigDecimal orderQuantity) {
        this.orderQuantity = orderQuantity;
    }

    public Long getOperatorId() {
        return operatorId;
    }

    public void setOperatorId(Long operatorId) {
        this.operatorId = operatorId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getBatchName() {
        return batchName;
    }

    public void setBatchName(String batchName) {
        this.batchName = batchName;
    }

    public Long getLnglatId() {
        return lnglatId;
    }

    public void setLnglatId(Long lnglatId) {
        this.lnglatId = lnglatId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        NetworkDelivery delivery = (NetworkDelivery) o;

        if (id != null ? !id.equals(delivery.id) : delivery.id != null) return false;
        if (pId != null ? !pId.equals(delivery.pId) : delivery.pId != null) return false;
        if (batchId != null ? !batchId.equals(delivery.batchId) : delivery.batchId != null) return false;
        if (name != null ? !name.equals(delivery.name) : delivery.name != null) return false;
        if (type != null ? !type.equals(delivery.type) : delivery.type != null) return false;
        if (lnglatId != null ? !lnglatId.equals(delivery.lnglatId) : delivery.lnglatId != null) return false;
        if (coordinateX != null ? !coordinateX.equals(delivery.coordinateX) : delivery.coordinateX != null)
            return false;
        if (coordinateY != null ? !coordinateY.equals(delivery.coordinateY) : delivery.coordinateY != null)
            return false;
        if (orderQuantity != null ? !orderQuantity.equals(delivery.orderQuantity) : delivery.orderQuantity != null)
            return false;
        if (operatorId != null ? !operatorId.equals(delivery.operatorId) : delivery.operatorId != null) return false;
        if (createTime != null ? !createTime.equals(delivery.createTime) : delivery.createTime != null) return false;
        return batchName != null ? batchName.equals(delivery.batchName) : delivery.batchName == null;

    }

    @Override
    public String toString() {
        return "NetworkDelivery{" +
                "id=" + id +
                ", pId=" + pId +
                ", batchId=" + batchId +
                ", name='" + name + '\'' +
                ", type=" + type +
                ", lnglatId=" + lnglatId +
                ", coordinateX=" + coordinateX +
                ", coordinateY=" + coordinateY +
                ", orderQuantity=" + orderQuantity +
                ", operatorId=" + operatorId +
                ", createTime=" + createTime +
                ", batchName='" + batchName + '\'' +
                '}';
    }
}
